<div id="left">

	Danh mục

	<div class="new-item"><a href="<?php echo site_url('admin/addNewCategory'); ?>">Tạo danh mục</a></div>

	<ul>		

		<?php 

			foreach($categories as $category)

			{

				echo '<li><a href="'.site_url('admin/showNewsOfCategory/'.$category['id']).'">' .$category['category']. '</a>';

				echo '&nbsp; [<a href="'.site_url('admin/editNewCategory/'.$category['id']).'">Edit</a>]'.  '</li>';

			}

		?>

	</ul>

</div>

<div id="main">

	<h2>D/s Tin Tức</h2>

	<div class="new-item"><a href="<?php echo site_url('admin/addNew'); ?>">Tạo tin mới</a></div>

	<table>

		<tr>

			<th>#</th>

			<th>Tiêu đề</th>

			<th>Hình ảnh</th>

			<th>Link</th>		

		</tr>

		<?php

			$i = 1;

			foreach($news as $new)
			{
				

				echo '

					<tr align="center">

						<td>'.$i.'</td>						

						<td>'.$new['title'].'</td>					

						<td><img src="'.base_url('upload/image/news/'.$new['image']).'" width="150px" height="100px"></td>

						<td><a href="'.site_url('home/new_detail/'.$new['id']).'" target="_blank">Link</a></td>

					</tr>

				';

				$i++;
			}

		?>

	</table>

</div>

<div style="clear: both;"></div>